/*
 * @(#)ServiceType.java $version 2010. 8. 11
 *
 * Copyright 2007-2010 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nhncorp.usf.core.service;

import com.nhncorp.usf.core.config.runtime.BusinessObject;
import com.nhncorp.usf.core.config.runtime.Method;
import com.nhncorp.usf.core.config.runtime.Service;
import com.nhncorp.usf.core.config.runtime.ServiceCondition;
import com.nhncorp.usf.core.config.runtime.ServiceConditionGroup;

/**
 * @author Web Platform Development Team.
 */
public enum ServiceType {
    bo, method, conditionBlock, other, conditionGroupBlock, bo_group, condition_script, choose, assign;

    /**
     * Gets the service type.
     *
     * @param serviceInfo the service info
     * @return the service type
     */
    public static ServiceType getServiceType(Service serviceInfo) {
        if (serviceInfo instanceof BusinessObject) {
            return ServiceType.bo;
        } else if (serviceInfo instanceof Method) {
            return ServiceType.method;
        } else if (serviceInfo instanceof ServiceCondition) {
            return ServiceType.conditionBlock;
        } else if (serviceInfo instanceof ServiceConditionGroup) {
        	return ServiceType.conditionGroupBlock;
        }

        return ServiceType.other;
    }
}
